﻿#ifndef DEVICE_H
#define DEVICE_H

#include <QObject>
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
#include <QVariant>

class Device : public QObject
{
    Q_OBJECT

public:
    explicit Device(QObject *parent = nullptr);

    QString strID() const;
    void setStrID(const QString &newStrID);
    QString &getStrID() { return m_strID; }

    virtual void writeXML(QXmlStreamWriter &writer) = 0;
    virtual void readFromXML(QXmlStreamReader &reader) = 0;

    virtual int initDevice() = 0;
    virtual void writeData(const QVariant &data) = 0;
    virtual void uninitDevice() = 0;

    virtual QString getClassName() = 0;

protected:
    QString m_strID;
};

#endif // DEVICE_H
